<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			// 实现如下类型的字符串:去掉空格+首字母大写
			var str = "hello world" // "i am" -- IAm
			
			// 截取和拼接
			var h = str.substr(0,1)  //"h" 字符串
			var index = str.indexOf(" ") //空格位置 5
			var ello = str.substring(1,index) // "ello"
			var w = str.substr(index+1,1) //"w"
			var orld = str.substr(index+2) //orld
			
			var str2 = h.toUpperCase() + ello + w.toUpperCase() + orld
			document.write(str2)
		</script>
	</body>
</html>
